package Vistas;

import Controladores.ControladorClasificador;
import Controladores.ControladorOntologia;
import Controladores.ControladorOperaciones;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import org.jdom.JDOMException;

/**
* @class MainFiltroView
* @author Mauricio Alvarez.
* @brief Esta clase representa la Vista de la aplicación y la interfaz gráfica
* para probar las métricas.
*/
public class MainFiltroView extends FrameView {


    /** @var private ControladorOntologia ontologia
     *  @brief variable global de tipo ControladorOntologia
    */
    private ControladorOntologia ontologia = new ControladorOntologia();
    /** @var private ControladorClasificador clasificador
     *  @brief variable global de tipo ControladorClasificador
    */
    private ControladorClasificador clasificador = new ControladorClasificador();
    /** @var private ControladorOperaciones operaciones
     *  @brief variable global de tipo ControladorOperaciones
    */
    private ControladorOperaciones operaciones = new ControladorOperaciones();

    /**
     * @brief Constructor de la clase MainFiltroView
     * @param SingleFrameApplication app
     * @return void
    */
    public MainFiltroView(SingleFrameApplication app) {

        super(app);

        initComponents();

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String)(evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer)(evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = MainFiltro.getApplication().getMainFrame();
            aboutBox = new MainFiltroAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        MainFiltro.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanelClasificador = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        topicoTx = new javax.swing.JTextField();
        CboxConsultaTx = new javax.swing.JCheckBox();
        jPanel4 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        CboxJaccard = new javax.swing.JCheckBox();
        CboxSimilitudCoseno = new javax.swing.JCheckBox();
        CboxEuclidiana = new javax.swing.JCheckBox();
        jLabel12 = new javax.swing.JLabel();
        okapiFactorK1Tx = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        okapiFactorbTx = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        TxIDFDinamico = new javax.swing.JTextField();
        jButton6 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        numeroPagTx = new javax.swing.JTextField();
        CboxTodasPaginas = new javax.swing.JCheckBox();
        jPanel5 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        umbralTx = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        rankingTx = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        CboxBody = new javax.swing.JCheckBox();
        CboxSurround = new javax.swing.JCheckBox();
        jPanelOpciones = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jButtonGuardarOntologia = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jButtonBorrarOntologia = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        ConceptoSemillaTx = new javax.swing.JTextField();
        CheckBoxTP = new javax.swing.JCheckBox();
        jLabel19 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        TasaMuestreoTx = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        NivelTx = new javax.swing.JTextField();
        jButton7 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        jLabel17 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jButton8 = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();

        mainPanel.setName("mainPanel"); // NOI18N

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(Vistas.MainFiltro.class).getContext().getResourceMap(MainFiltroView.class);
        jPanelClasificador.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanelClasificador.border.title"))); // NOI18N
        jPanelClasificador.setName("jPanelClasificador"); // NOI18N

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        topicoTx.setText(resourceMap.getString("topicoTx.text")); // NOI18N
        topicoTx.setName("topicoTx"); // NOI18N

        CboxConsultaTx.setText(resourceMap.getString("CboxConsultaTx.text")); // NOI18N
        CboxConsultaTx.setName("CboxConsultaTx"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(topicoTx, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)
                .addComponent(CboxConsultaTx))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(CboxConsultaTx)
                    .addComponent(jLabel6)
                    .addComponent(topicoTx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel4.border.title"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        CboxJaccard.setText(resourceMap.getString("CboxJaccard.text")); // NOI18N
        CboxJaccard.setName("CboxJaccard"); // NOI18N

        CboxSimilitudCoseno.setText(resourceMap.getString("CboxSimilitudCoseno.text")); // NOI18N
        CboxSimilitudCoseno.setName("CboxSimilitudCoseno"); // NOI18N

        CboxEuclidiana.setText(resourceMap.getString("CboxEuclidiana.text")); // NOI18N
        CboxEuclidiana.setName("CboxEuclidiana"); // NOI18N

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        okapiFactorK1Tx.setText(resourceMap.getString("okapiFactorK1Tx.text")); // NOI18N
        okapiFactorK1Tx.setName("okapiFactorK1Tx"); // NOI18N

        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        okapiFactorbTx.setText(resourceMap.getString("okapiFactorbTx.text")); // NOI18N
        okapiFactorbTx.setName("okapiFactorbTx"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
        jLabel23.setName("jLabel23"); // NOI18N

        TxIDFDinamico.setText(resourceMap.getString("TxIDFDinamico.text")); // NOI18N
        TxIDFDinamico.setName("TxIDFDinamico"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jLabel16))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(CboxEuclidiana)
                            .addComponent(CboxSimilitudCoseno)
                            .addComponent(CboxJaccard)
                            .addComponent(jLabel7)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGap(21, 21, 21)
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel13)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(okapiFactorbTx, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel12)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(okapiFactorK1Tx)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel15)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addComponent(jLabel14)
                                        .addGap(24, 24, 24)
                                        .addComponent(jLabel23)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(TxIDFDinamico, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addContainerGap(47, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CboxJaccard)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CboxSimilitudCoseno)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CboxEuclidiana)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel16)
                .addGap(7, 7, 7)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(okapiFactorK1Tx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(TxIDFDinamico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(okapiFactorbTx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(Vistas.MainFiltro.class).getContext().getActionMap(MainFiltroView.class, this);
        jButton6.setAction(actionMap.get("ClasificarContenido")); // NOI18N
        jButton6.setText(resourceMap.getString("jButton6.text")); // NOI18N
        jButton6.setName("jButton6"); // NOI18N

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel7.border.title"))); // NOI18N
        jPanel7.setName("jPanel7"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        numeroPagTx.setText(resourceMap.getString("numeroPagTx.text")); // NOI18N
        numeroPagTx.setName("numeroPagTx"); // NOI18N

        CboxTodasPaginas.setText(resourceMap.getString("CboxTodasPaginas.text")); // NOI18N
        CboxTodasPaginas.setName("CboxTodasPaginas"); // NOI18N

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(numeroPagTx, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(CboxTodasPaginas)
                .addContainerGap(76, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(numeroPagTx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CboxTodasPaginas))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel5.border.title"))); // NOI18N
        jPanel5.setName("jPanel5"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        umbralTx.setText(resourceMap.getString("umbralTx.text")); // NOI18N
        umbralTx.setName("umbralTx"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        rankingTx.setText(resourceMap.getString("rankingTx.text")); // NOI18N
        rankingTx.setName("rankingTx"); // NOI18N

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        CboxBody.setText(resourceMap.getString("CboxBody.text")); // NOI18N
        CboxBody.setName("CboxBody"); // NOI18N

        CboxSurround.setText(resourceMap.getString("CboxSurround.text")); // NOI18N
        CboxSurround.setName("CboxSurround"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(6, 6, 6)
                        .addComponent(umbralTx, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(rankingTx, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel11)))
                .addGap(32, 32, 32)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(CboxBody)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(CboxSurround)
                .addContainerGap(13, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(umbralTx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(CboxBody)
                    .addComponent(CboxSurround))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(rankingTx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addContainerGap(6, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanelClasificadorLayout = new javax.swing.GroupLayout(jPanelClasificador);
        jPanelClasificador.setLayout(jPanelClasificadorLayout);
        jPanelClasificadorLayout.setHorizontalGroup(
            jPanelClasificadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelClasificadorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelClasificadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton6, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanelClasificadorLayout.setVerticalGroup(
            jPanelClasificadorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelClasificadorLayout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton6)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel7.getAccessibleContext().setAccessibleName(resourceMap.getString("jPanel7.AccessibleContext.accessibleName")); // NOI18N

        jTabbedPane1.addTab(resourceMap.getString("jPanelClasificador.TabConstraints.tabTitle"), jPanelClasificador); // NOI18N

        jPanelOpciones.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanelOpciones.border.title"))); // NOI18N
        jPanelOpciones.setName("jPanelOpciones"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jButtonGuardarOntologia.setAction(actionMap.get("GuardarOntologia")); // NOI18N
        jButtonGuardarOntologia.setText(resourceMap.getString("jButtonGuardarOntologia.text")); // NOI18N
        jButtonGuardarOntologia.setName("jButtonGuardarOntologia"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jButtonBorrarOntologia.setAction(actionMap.get("BorrarOntologia")); // NOI18N
        jButtonBorrarOntologia.setText(resourceMap.getString("jButtonBorrarOntologia.text")); // NOI18N
        jButtonBorrarOntologia.setName("jButtonBorrarOntologia"); // NOI18N

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel8.border.title"))); // NOI18N
        jPanel8.setName("jPanel8"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        ConceptoSemillaTx.setText(resourceMap.getString("ConceptoSemillaTx.text")); // NOI18N
        ConceptoSemillaTx.setName("ConceptoSemillaTx"); // NOI18N

        CheckBoxTP.setText(resourceMap.getString("CheckBoxTP.text")); // NOI18N
        CheckBoxTP.setName("CheckBoxTP"); // NOI18N

        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jButton3.setAction(actionMap.get("BorrarSubtopicos")); // NOI18N
        jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
        jButton3.setName("jButton3"); // NOI18N

        jButton4.setAction(actionMap.get("GuardarSubtopicos")); // NOI18N
        jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
        jButton4.setName("jButton4"); // NOI18N

        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        TasaMuestreoTx.setText(resourceMap.getString("TasaMuestreoTx.text")); // NOI18N
        TasaMuestreoTx.setName("TasaMuestreoTx"); // NOI18N

        jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
        jLabel22.setName("jLabel22"); // NOI18N

        NivelTx.setText(resourceMap.getString("NivelTx.text")); // NOI18N
        NivelTx.setName("NivelTx"); // NOI18N

        jButton7.setAction(actionMap.get("GenerarRamasConsultas")); // NOI18N
        jButton7.setText(resourceMap.getString("jButton7.text")); // NOI18N
        jButton7.setName("jButton7"); // NOI18N

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                        .addGap(94, 94, 94)
                        .addComponent(jLabel19)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
                            .addComponent(jButton4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel8Layout.createSequentialGroup()
                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(ConceptoSemillaTx)
                                .addComponent(jLabel3))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(CheckBoxTP))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                            .addComponent(jLabel21)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(TasaMuestreoTx, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel22)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(NivelTx, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jButton7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3)
                .addGap(2, 2, 2)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ConceptoSemillaTx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CheckBoxTP))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton3)
                    .addComponent(jLabel19))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jLabel22)
                    .addComponent(NivelTx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TasaMuestreoTx, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton7)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel1))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonGuardarOntologia, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)
                            .addComponent(jButtonBorrarOntologia, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE))
                        .addGap(144, 144, 144))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jButtonGuardarOntologia))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jButtonBorrarOntologia))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jButton5.setAction(actionMap.get("GuardarStopword")); // NOI18N
        jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N
        jButton5.setName("jButton5"); // NOI18N

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jButton1.setAction(actionMap.get("BorrarStopwords")); // NOI18N
        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addGap(18, 18, 18)
                        .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton5)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jButton5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel17)
                    .addComponent(jButton1))
                .addContainerGap())
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel6.border.title"))); // NOI18N
        jPanel6.setName("jPanel6"); // NOI18N

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jButton2.setAction(actionMap.get("BorrarMediciones")); // NOI18N
        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
        jButton2.setName("jButton2"); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addComponent(jLabel18)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton2)
                .addContainerGap(27, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jLabel18))
                .addContainerGap(34, Short.MAX_VALUE))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel9.border.title"))); // NOI18N
        jPanel9.setName("jPanel9"); // NOI18N

        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        jButton8.setAction(actionMap.get("BorrarPaginas")); // NOI18N
        jButton8.setText(resourceMap.getString("jButton8.text")); // NOI18N
        jButton8.setName("jButton8"); // NOI18N

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel20)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton8)
                .addContainerGap(255, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jButton8))
                .addContainerGap(1, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanelOpcionesLayout = new javax.swing.GroupLayout(jPanelOpciones);
        jPanelOpciones.setLayout(jPanelOpcionesLayout);
        jPanelOpcionesLayout.setHorizontalGroup(
            jPanelOpcionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelOpcionesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelOpcionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanelOpcionesLayout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanelOpcionesLayout.setVerticalGroup(
            jPanelOpcionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelOpcionesLayout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelOpcionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanelOpciones.TabConstraints.tabTitle"), jPanelOpciones); // NOI18N

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 466, Short.MAX_VALUE)
                .addContainerGap())
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 545, Short.MAX_VALUE)
                .addContainerGap())
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 316, Short.MAX_VALUE)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusAnimationLabel)
                .addContainerGap())
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents


    ////////////////////////////////////////////////////////////////////////////
    //                     OPERACIONES PRE-CLASIFICADOR                       //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * @brief Envía la petición para guardar la ONTOLOGÍA a la base de datos
     * desde el archivo de texto "topicos.owl.xml".
     * @param no tiene
     * @return void
    */
    @Action
    public void GuardarOntologia()
    {
        try {
            ontologia.GuardarOntologia();
            JOptionPane.showMessageDialog(null, "Se ha guardado la ontología correctamente", "AVISO", JOptionPane.INFORMATION_MESSAGE);
        } catch (JDOMException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo guardar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo guardar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo guardar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo guardar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo guardar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo guardar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//FIN GuardarOntologia (OK)


    /**
     * @brief Envía la petición para borrar la ONTOLOGÍA de la base de datos
     * @param no tiene
     * @return void
    */
    @Action
    public void BorrarOntologia()
    {
        try {
            ontologia.BorrarOntologia();
            JOptionPane.showMessageDialog(null, "Se ha borrado la ontología correctamente", "AVISO", JOptionPane.INFORMATION_MESSAGE);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "No se puedo borrar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
        } catch (InstantiationException ex) {
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "No se puedo borrar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
        } catch (IllegalAccessException ex) {
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "No se puedo borrar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
        } catch (IOException ex) {
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "No se puedo borrar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
        } catch (SQLException ex) {
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "No se puedo borrar la ontología.", "ERROR", JOptionPane.ERROR_MESSAGE);
        }

    }//FIN BorrarOntologia (OK)


    /**
     * @brief Guarda los subtopicos extraidos desde un concepto de la ontología..
     * @param no tiene
     * @return void
    */
    @Action
    public void GuardarSubtopicos()
    {
        //Este List Almacena los conceptos semilla:
        List<String> ConceptosSemilla = new ArrayList();

        ////////////////////////////////////////////////////////////////
        //PASO 1: Se verifica si esta seleccionado el CheckBoxTP
        ////////////////////////////////////////////////////////////////
        if (CheckBoxTP.isSelected() == true)
        {
            try {

                ////////////////////////////////////////////////////////////////
                // VARIANTE 1: Sin considerar Historia de Chile como principal.
                ////////////////////////////////////////////////////////////////

                //Se consideran los tópicos principales como conceptos semilla:
                ConceptosSemilla.add("ambito social");
                ConceptosSemilla.add("ambito politico");
                ConceptosSemilla.add("ambito cultural");
                ConceptosSemilla.add("ambito economico");
                ConceptosSemilla.add("ambito geografico");
                ConceptosSemilla.add("ambito publico");

                ////////////////////////////////////////////////////////////////
                // VARIANTE 1: Considerando Historia de Chile como principal.
                ////////////////////////////////////////////////////////////////
                //El nuevo tópico principal:
                //ConceptosSemilla.add("historia de chile");

                //Se invoca al metodo con los topicos principales:
                ontologia.GuardarSubtopicos(ConceptosSemilla);

                JOptionPane.showMessageDialog(null, "Se ha guardado las ramas sub-tópicos correctamente", "AVISO", JOptionPane.INFORMATION_MESSAGE);

            } catch (ClassNotFoundException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR 1", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR 2", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR 3", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR 4", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR 5", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            }

        }else{
            
            try {
                //Se considera como semilla el concepto ingresado:
                String ConceptoSemilla = ConceptoSemillaTx.getText().toLowerCase().replaceAll("á", "a").replaceAll("é", "e").replaceAll("í", "i").replaceAll("ó", "o").replaceAll("ú", "u");

                //Se agrega a la lista:
                ConceptosSemilla.add(ConceptoSemilla);
                //Se invoca al metodo con los topicos principales:
                ontologia.GuardarSubtopicos(ConceptosSemilla);

                JOptionPane.showMessageDialog(null, "Se ha guardado las ramas sub-tópicos correctamente", "AVISO", JOptionPane.INFORMATION_MESSAGE);
                
            } catch (ClassNotFoundException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            } catch (SQLException ex) {
                JOptionPane.showMessageDialog(null, "No se puedo guardar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
                Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
            }

        }

    }//FIN GuardarSubtopicos


    /**
     * @brief Borra los subtopicos de la BD generados por las ramas de la ontología.
     * @param no tiene
     * @return void
    */
    @Action
    public void BorrarSubtopicos()
    {
        try {
            ontologia.BorrarSubtopicos();
            JOptionPane.showMessageDialog(null, "Se ha borrado las ramas sub-tópicos correctamente", "AVISO", JOptionPane.INFORMATION_MESSAGE);
        } //FIN BorrarSubtopicos
        catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las ramas sub-tópicos.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//FIN BorrarSubtopicos


    /**
     * @brief Genera las ramas para las mediciones, los cuales conforma las consultas para las pruebas.
     * @param no tiene
     * @return void
    */
    @Action
    public void GenerarRamasConsultas()
    {
        try {
            //Se setea la tasa de muestreo y el nivel:
            int TasaMuestreo = Integer.valueOf(TasaMuestreoTx.getText());
            int Nivel = Integer.valueOf(NivelTx.getText());
            //Se invoca al metodo que genera las ramas de consulta:
            ontologia.GenerarRamasConsultas(TasaMuestreo, Nivel);
            JOptionPane.showMessageDialog(null, "Se han generado las ramas sub-tópicos para la muestra correctamente", "AVISO", JOptionPane.INFORMATION_MESSAGE);
        } //FIN GenerarRamasConsultas
        catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo generar las consultas de lasramas sub-tópicos para la muestra.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo generar las consultas de lasramas sub-tópicos para la muestra.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo generar las consultas de lasramas sub-tópicos para la muestra.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo generar las consultas de lasramas sub-tópicos para la muestra.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo generar las consultas de lasramas sub-tópicos para la muestra.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//FIN GenerarRamasConsultas


    /**
     * @brief Envía la petición para guardar los STOPWORDS a la base de datos
     * desde el archivo de texto stopwords_es.txt.
     * @param no tiene
     * @return void
    */
    @Action
    public void GuardarStopword() throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException
    {
        operaciones.GuardarStopwords();
        JOptionPane.showMessageDialog(null, "Stopwords guardados con éxito.", "AVISO", JOptionPane.INFORMATION_MESSAGE);

    }//FIN GuardarStopword (OK)


    /**
     * @brief Envía la petición para eliminar los STOPWORDS a la base de datos.
     * @param no tiene
     * @return void
    */
    @Action
    public void BorrarStopwords()
    {
        try {

            operaciones.BorrarStopwords();
            JOptionPane.showMessageDialog(null, "Stopwords borrados con éxito.", "AVISO", JOptionPane.INFORMATION_MESSAGE);
        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los Stopwords.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los Stopwords.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los Stopwords.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los Stopwords.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los Stopwords.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//FIN BorrarStopwords(OK)


    /**
     * @brief Envía la petición para eliminar de la base de datos las mediciones
     * de las métricas.
     * @param no tiene
     * @return void
    */
    @Action
    public void BorrarMediciones()
    {
        try {
            operaciones.BorrarMediciones();
            JOptionPane.showMessageDialog(null, "Mediciones borradas con éxito.", "AVISO", JOptionPane.INFORMATION_MESSAGE);
        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las mediciones.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los mediciones.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los mediciones.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los mediciones.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar los mediciones.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        }

    }//FIN BorrarMediciones (OK)



    ////////////////////////////////////////////////////////////////////////////
    //                     OPERACIONES CLASIFICADOR                           //
    ////////////////////////////////////////////////////////////////////////////
    
    /**
     * @brief Se invoca al clasificador con los parámetros configurados para las
     * pruebas.
     * @param no tiene
     * @return void
    */
    @Action
    public void ClasificarContenido() throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, SQLException, FileNotFoundException, Error, Exception
    {

        //Guarda las opciones de las métricas a evaluar:
        ArrayList MetricasSeleccionadas = new ArrayList();

        //Guarda las opciones de los contenidos a evaluar:
        ArrayList ContenidosSeleccionados = new ArrayList();

        int CantidadPaginas = 0;
        boolean SeleccionMetrica = false;
        boolean SeleccionTermino = false;
        int N_IDF_DINAMICO = Integer.valueOf(TxIDFDinamico.getText());

        //Se establece la consulta:
        String Consulta = topicoTx.getText();
        //Se establece el factor K1 de Okapi:
        double factorK1 = Double.valueOf(okapiFactorK1Tx.getText());
        //Se establece el factor b de Okapi:
        double factorb = Double.valueOf(okapiFactorbTx.getText());
        //Se establece el umbral:
        double umbral = Double.valueOf(umbralTx.getText());
        //Se establece el ranking:
        int ranking = Integer.valueOf(rankingTx.getText());


        ////////////////////////////////////////////////////////////////////////
        // PASO 1: Se establecen las metricas seleccionadas para el estudio:
        ////////////////////////////////////////////////////////////////////////

        //JACCARD:
        if (CboxJaccard.isSelected()==true)
        {
            MetricasSeleccionadas.add(1);
            SeleccionMetrica = true;
        }else{
            MetricasSeleccionadas.add(0);
        }
        //SIMILITUD COSENO:
        if (CboxSimilitudCoseno.isSelected()==true)
        {
            MetricasSeleccionadas.add(1);
            SeleccionMetrica = true;
        }else{
            MetricasSeleccionadas.add(0);
        }
        //EUCLIDIANA:
        if (CboxEuclidiana.isSelected()==true)
        {
            MetricasSeleccionadas.add(1);
            SeleccionMetrica = true;
        }else{
            MetricasSeleccionadas.add(0);
        }


        ////////////////////////////////////////////////////////////////////////
        // PASO 2: Se establecen los contenidos seleccionados para el estudio:
        //         (si se evalua el BODY, SURROUND TEXT o ambas de las páginas).
        ////////////////////////////////////////////////////////////////////////

        //SE EVALUA BODY:
        if (CboxBody.isSelected()==true)
        {
            ContenidosSeleccionados.add(1);
            SeleccionMetrica = true;
        }else{
            ContenidosSeleccionados.add(0);
        }
        //SE EVALUA ANCHOR TEXT:
        if (CboxSurround.isSelected()==true)
        {
            ContenidosSeleccionados.add(1);
            SeleccionMetrica = true;
        }else{
            ContenidosSeleccionados.add(0);
        }


        ////////////////////////////////////////////////////////////////////////
        // PASO 3: Se invoca al clasificador:
        ////////////////////////////////////////////////////////////////////////

        //Si esta seleccionada, usar todas las páginas para el estudio:
        if ((CboxTodasPaginas.isSelected() == true))
        {
            if (SeleccionMetrica == true)
            {
                //Indica al clasificador con -1 que se seleccionan todas las páginas:
                CantidadPaginas = -1;

                //Se ve si se considera la consulta como topico o termino solamente.
                if (CboxConsultaTx.isSelected() == true)
                {
                    /**
                     *  CONSULTA COMO TOPICO
                    */

                    //Indica al clasificador que el termino es considerados como concepto aislado:
                    SeleccionTermino = true;
                    
                    //Si el valor del k1 o b son nulos o ceros:
                    if ((factorK1 != 0) && (factorb != 0))
                    {
                        //Se pregunta si se seleccionó el contenido de la página a evaluar (body o surround text o ambas):
                        if (CboxBody.isSelected()==false && CboxSurround.isSelected()==false)
                        {
                            //ERROR:
                            JOptionPane.showMessageDialog(null, "Seleccione el contenido a evaluar.", "ERROR", JOptionPane.WARNING_MESSAGE);
                        }else{
                            //Se invoca al clasificador:
                            clasificador.Clasificador(Consulta, MetricasSeleccionadas, ContenidosSeleccionados, CantidadPaginas, umbral, ranking, SeleccionTermino, factorK1, factorb, N_IDF_DINAMICO);
                            JOptionPane.showMessageDialog(null, "Estudio realizado con éxito.", "AVISO", JOptionPane.INFORMATION_MESSAGE);
                        }
                    }else{
                        //ERROR:
                        JOptionPane.showMessageDialog(null, "Los factores Okapi deben ser mayores a cero.", "ERROR", JOptionPane.WARNING_MESSAGE);
                    }              
                    
                }else{

                    /**
                     *  CONSULTA COMO TÉRMINO
                    */

                    //Si el valor del k1 o b son nulos o ceros:
                    if ((factorK1 != 0) && (factorb != 0))
                    {
                        //Se pregunta si se seleccionó el contenido de la página a evaluar (body o anchor text o ambas):
                        if (CboxBody.isSelected()==false && CboxSurround.isSelected()==false)
                        {
                            //ERROR:
                            JOptionPane.showMessageDialog(null, "Seleccione el contenido a evaluar.", "ERROR", JOptionPane.WARNING_MESSAGE);
                        }else{
                            //Se invoca al clasificador:
                            clasificador.Clasificador(Consulta, MetricasSeleccionadas, ContenidosSeleccionados, CantidadPaginas, umbral, ranking, SeleccionTermino, factorK1, factorb, N_IDF_DINAMICO);
                            JOptionPane.showMessageDialog(null, "Estudio realizado con éxito.", "AVISO", JOptionPane.INFORMATION_MESSAGE);
                        }

                    }else{
                        //ERROR:
                        JOptionPane.showMessageDialog(null, "Los factores Okapi deben ser mayores a cero.", "ERROR", JOptionPane.WARNING_MESSAGE);
                    }
                }

            }else{
                //ERROR:
                JOptionPane.showMessageDialog(null, "No ha seleccionado ninguna metrica.", "ERROR", JOptionPane.WARNING_MESSAGE);

            }

        }else{

            //Si no esta seleccionada, usar la cantidad de páginas especificada:
            if ((numeroPagTx.getText().isEmpty()))
            {
                //ERROR:
                JOptionPane.showMessageDialog(null, "No ha ingresado la cantidad de páginas del estudio.", "ERROR", JOptionPane.WARNING_MESSAGE);
            }else{

                //Se setea la cantidad de páginas del estudio:
                CantidadPaginas = Integer.valueOf(numeroPagTx.getText());

                if (SeleccionMetrica == true)
                {
                    //Se ve si se considera la consulta como topico o termino solamente.
                    if (CboxConsultaTx.isSelected() == true)
                    {
                        SeleccionTermino = true;
                        //Si el valor del k1 o b son nulos o ceros:
                        if ((factorK1 != 0) && (factorb != 0))
                        {
                            //Se pregunta si se seleccionó el contenido de la página a evaluar (body o anchor text o ambas):
                            if (CboxBody.isSelected()==false && CboxSurround.isSelected()==false)
                            {
                                //ERROR:
                                JOptionPane.showMessageDialog(null, "Seleccione el contenido a evaluar.", "ERROR", JOptionPane.WARNING_MESSAGE);
                            }else{
                                //Se invoca al clasificador:
                                clasificador.Clasificador(Consulta, MetricasSeleccionadas, ContenidosSeleccionados, CantidadPaginas, umbral, ranking, SeleccionTermino, factorK1, factorb, N_IDF_DINAMICO);
                                JOptionPane.showMessageDialog(null, "Estudio realizado con éxito.", "AVISO", JOptionPane.INFORMATION_MESSAGE);
                            }

                        }else{
                            //ERROR:
                            JOptionPane.showMessageDialog(null, "Los factores Okapi deben ser mayores a cero.", "ERROR", JOptionPane.WARNING_MESSAGE);
                        }
                    }else{
                        //Si el valor del k1 o b son nulos o ceros:
                        if ((factorK1 != 0) && (factorb != 0))
                        {
                            //Se pregunta si se seleccionó el contenido de la página a evaluar (body o anchor text o ambas):
                            if (CboxBody.isSelected()==false && CboxSurround.isSelected()==false)
                            {
                                //ERROR:
                                JOptionPane.showMessageDialog(null, "Seleccione el contenido a evaluar.", "ERROR", JOptionPane.WARNING_MESSAGE);
                            }else{
                                //Se invoca al clasificador:
                                clasificador.Clasificador(Consulta, MetricasSeleccionadas, ContenidosSeleccionados, CantidadPaginas, umbral, ranking, SeleccionTermino, factorK1, factorb, N_IDF_DINAMICO);
                                JOptionPane.showMessageDialog(null, "Estudio realizado con éxito.", "AVISO", JOptionPane.INFORMATION_MESSAGE);
                            }

                        }else{
                            //ERROR:
                            JOptionPane.showMessageDialog(null, "Los factores Okapi deben ser mayores a cero.", "ERROR", JOptionPane.WARNING_MESSAGE);
                        }
                    }
                }else{
                    //ERROR:
                    JOptionPane.showMessageDialog(null, "No ha seleccionado ninguna metrica.", "ERROR", JOptionPane.WARNING_MESSAGE);
                }
            }

        }

    }//FIN ClasificarContenido

    @Action
    public void BorrarPaginas() 
    {
        try {
            operaciones.BorrarPaginas();
            JOptionPane.showMessageDialog(null, "Páginas de la muestra borradas con éxito.", "AVISO", JOptionPane.INFORMATION_MESSAGE);
        } catch (ClassNotFoundException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las páginas.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las páginas.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las páginas.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las páginas.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se puedo borrar las páginas.", "ERROR", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFiltroView.class.getName()).log(Level.SEVERE, null, ex);
        }

    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox CboxBody;
    private javax.swing.JCheckBox CboxConsultaTx;
    private javax.swing.JCheckBox CboxEuclidiana;
    private javax.swing.JCheckBox CboxJaccard;
    private javax.swing.JCheckBox CboxSimilitudCoseno;
    private javax.swing.JCheckBox CboxSurround;
    private javax.swing.JCheckBox CboxTodasPaginas;
    private javax.swing.JCheckBox CheckBoxTP;
    private javax.swing.JTextField ConceptoSemillaTx;
    private javax.swing.JTextField NivelTx;
    private javax.swing.JTextField TasaMuestreoTx;
    private javax.swing.JTextField TxIDFDinamico;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButtonBorrarOntologia;
    private javax.swing.JButton jButtonGuardarOntologia;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPanel jPanelClasificador;
    private javax.swing.JPanel jPanelOpciones;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JTextField numeroPagTx;
    private javax.swing.JTextField okapiFactorK1Tx;
    private javax.swing.JTextField okapiFactorbTx;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JTextField rankingTx;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JTextField topicoTx;
    private javax.swing.JTextField umbralTx;
    // End of variables declaration//GEN-END:variables

    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;

    private JDialog aboutBox;

}//FIN CLASE MainFiltroView (OK)